exports.answerCommentAllReply = function (req, res) {

    //获取restful参数
    var restfulParams = req.routeInfo.restfulParams;
    //最终结果
    var resultData = {};

    var skip = restfulParams.skip == undefined ? 0 : restfulParams.skip;

    var limit = restfulParams.limit == undefined ? config.publicConfig.LIMIT : restfulParams.limit;

    //任务流创建
    async.waterfall([
            function (cb) {
                R.SEND_HTTP(
                    req,
                    {
                        url: CORE_APIConfig.coreAPI.search_answer_comment_userinfo + "/fcac_fid/" + restfulParams.fcac_id  + "/skip/" + skip + "/limit/" + limit,
                        method: 'POST',
                        data: {
                            fields: ["u_id","u_header_url", "u_nickname", "u_type","u_oid", "fcac_content as fac_content", "fcac_create_time as fac_create_time","fcac_fid"].join(",")
                        }
                    },
                    function (err, data) {
                        //判断是否有错误信息
                        if (err) {
                            return cb(err, data);
                        }

                        resultData.allCommentReplyData = data.data;
                        cb();
                    }
                );

            },
        function (cb) {

            var allCommentReplyData = resultData.allCommentReplyData;

            var tasks = [];

            allCommentReplyData.forEach(function (item, i) {

                tasks.push(function (cb) {
                        R.SEND_HTTP(
                            req,
                            {
                                url: CORE_APIConfig.coreAPI.searchOrganization + "/o_uid/" + item.u_id,
                                method: 'POST',
                                data: {
                                    fields: ["o_name", "o_logo"].join(",")
                                }
                            },
                            function (err, data) {

                                //判断是否有错误信息
                                if (err) {
                                    return cb(err, data);
                                }

                                var organizationData = data.data[0];

                                if(data.data.length>0){
                                    item.isOrganization = 1;

                                    item.o_name = organizationData.o_name;

                                    item.o_logo = organizationData.o_logo;

                                    cb();
                                }else{
                                    item.isOrganization = 0;

                                    cb()

                                }

                            }
                        );

                })
            });
            async.waterfall(tasks, cb);
        },
        ], function (err, result) {

            //返回最终拼接结果
            RES.response(res, true, resultData);

        }
    );

}